﻿'use strict';

var RequestsApp = angular.module('RequestsApp', ['ngRoute','spFields']);

RequestsApp.run(['$rootScope', '$log', 'repositoryConfigurator', function ($rootScope, $log, repositoryConfigurator) {
    JSRequest.EnsureSetup();
    $rootScope.HostWebUrl = decodeURIComponent(JSRequest.QueryString.SPHostUrl);
    $rootScope.AppWebUrl = decodeURIComponent(JSRequest.QueryString.SPAppWebUrl);
    $rootScope.RequestsListName = 'Requests';

    repositoryConfigurator.verifyRepositoryConfiguration()
    .then(function (jsonObject) { },
          function (err) {$log.error(JSON.stringify(err));
    });
}]);